/**
 * 
 * @description 全局自定义插件 -- 劝阻组件、过滤器、指令
 */

// import MainLayout from './MainLayout.vue'
// import BlankLayout from './BlankLayout.vue'

const MainLayout = () => import('./MainLayout.vue')
const BlankLayout = () => import('./BlankLayout.vue')
const pageLayout = () => import('./pageLayout.vue')

const plugin = function(VC) {
    // 全局组件
    VC.component("MainLayout",MainLayout)
    VC.component("BlankLayout",BlankLayout)
    VC.component("pageLayout",pageLayout)

    // 全局过滤器
    VC.filter('typeFilter',function(val,types) {
        // debugger
        let dict = types.find(it => it.code === val)
        if(!dict) {
            return val
        }
        return dict.name
    })
}

export default plugin